package game.model.time
{
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	import game.constants.ApplicationNotification;
	import game.model.texture.vo.TextureVO;
	import org.puremvc.as3.interfaces.IProxy;
	import org.puremvc.as3.patterns.proxy.Proxy;

	/**
	 * ...
	 * @author Thot
	 */
	
	public class TimeProxy extends Proxy implements IProxy
	{
		
		static public var NAME:String = 'TimeProxy';
		
		private var _timer:Timer;
		
		public function TimeProxy()
		{ 
			super( NAME, null );
			_timer = new Timer(1000, 0);
			_timer.addEventListener(TimerEvent.TIMER, tickHandler );
		}
		
		
		public function start():void
		{
			_timer.start();
		}
		
		public function stop():void
		{
			_timer.stop();
		}
		
		public function reset():void
		{
			_timer.reset();
		}
		
		private function tickHandler(e:TimerEvent):void 
		{
			facade.sendNotification( ApplicationNotification.UPDATE_DATA );
		}
		
		
		
	}

}